#!/bin/bash
function pause()
{
read -p "$*"
}
EO=""
AO=""
p=0
f=0

EO="Component Fail"
AO=$(java -jar Grades.jar 30 41)
if [ "$EO" != "$AO" ]
then let "f += 1"
else let "p += 1"
fi

echo Parameters: 41, 30
echo Expected Output: Component Fail
java -jar Grades.jar 41 30

EO="Component Fail"
AO=$(java -jar Grades.jar 41 30)
if [ "$EO" != "$AO" ]
then let "f += 1"
else let "p += 1"
fi

echo Parameters: 60 60
echo Expected Output: Pass
java -jar Grades.jar 60 60

EO="Pass"
AO=$(java -jar Grades.jar 60 60)
if [ "$EO" != "$AO" ]
then let "f += 1"
else let "p += 1"
fi

echo Parameters: 99, 99
echo Expected Output: Pass with distinction
java -jar Grades.jar 99 99

EO="Pass with distinction"
AO=$(java -jar Grades.jar 99 99)
if [ "$EO" != "$AO" ]
then let "f += 1"
else let "p += 1"
fi

echo Parameters: 100, 100
echo Expected Output: Pass with distinction
java -jar Grades.jar 100 100

EO="Pass with distinction"
AO=$(java -jar Grades.jar 100 100)
if [ "$EO" != "$AO" ]
then let "f += 1"
else let "p += 1"
fi


echo $p tests were succesful and $f tests were not
pause 'Press [Enter] key to continue . . .'
